package cn.seocoo.platform.web.controller.freeback;

import cn.seocoo.platform.common.annotation.Log;
import cn.seocoo.platform.common.core.controller.BaseController;
import cn.seocoo.platform.common.core.domain.AjaxResult;
import cn.seocoo.platform.common.core.page.TableDataInfo;
import cn.seocoo.platform.common.enums.BusinessType;
import cn.seocoo.platform.common.utils.AmountUtils;
import cn.seocoo.platform.common.utils.StringUtils;
import cn.seocoo.platform.common.utils.poi.ExcelUtil;
import cn.seocoo.platform.freeback.domain.Freeback;
import cn.seocoo.platform.freeback.service.IFreebackService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 意见反馈 信息操作处理
 * 
 * @author wujian
 * @date 2019-12-19
 */
@Controller
@RequestMapping("/second/freeback")
public class FreebackController extends BaseController
{
    private String prefix = "freeback";
	
	@Autowired
	private IFreebackService freebackService;
	
	@RequiresPermissions("second:freeback:view")
	@GetMapping()
	public String freeback()
	{
	    return prefix + "/freeback";
	}
	
	/**
	 * 查询意见反馈列表
	 */
	@PostMapping("/list")
	@ResponseBody
	public TableDataInfo list(Freeback freeback)
	{
		startPage();
        List<Freeback> list = freebackService.selectPcFreebackList(freeback);
		return getDataTable(list);
	}

	/**
	 * 素材详情
	 */
	@GetMapping("/detail/{id}")
	public String detail(@PathVariable("id") Integer id, ModelMap mmap) {
		Freeback freeback = freebackService.selectFreebackById(id);
		mmap.put("freeback",freeback);
		return prefix + "/detail";
	}
	

	
}
